1 //+------------------------------------------------------------------+
\r
3 //| Copyright © 2009, MetaQuotes Software Corp. |
\r
4 //| http://www.metaquotes.net |
\r
5 //+------------------------------------------------------------------+
\r
6 #property indicator_separate_window
\r
7 #property indicator_buffers 2
\r
8 #property indicator_color1 Red
\r
9 #property indicator_color2 Lime
\r
10 #property indicator_level1 -150000
\r
11 #property indicator_level2 150000
\r
13 //---- input parameters
\r
14 extern double lag_p =0.70;
\r
15 extern int MA_Period=13;
\r
16 extern int MA_Shift=0;
\r
17 extern int MA_Method=0;
\r
18 extern int NumberOfBarsToCalculate = 10000;
\r
20 //---- indicator buffers
\r
26 //+------------------------------------------------------------------+
\r
27 //| Custom indicator initialization function |
\r
28 //+------------------------------------------------------------------+
\r
32 IndicatorBuffers(4);
\r
33 //---- indicator line
\r
34 SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,2);
\r
35 SetIndexStyle(1,DRAW_LINE,STYLE_SOLID,2);
\r
36 SetIndexStyle(2,DRAW_NONE);
\r
37 SetIndexStyle(3,DRAW_NONE);
\r
39 SetIndexBuffer(0,Buffer0);
\r
40 SetIndexBuffer(1,Buffer1);
\r
41 SetIndexBuffer(2,Ma);
\r
42 SetIndexBuffer(3,Lag);
\r
45 IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS));
\r
48 SetIndexEmptyValue(0,0);
\r
49 SetIndexEmptyValue(1,0);
\r
50 SetIndexEmptyValue(2,0);
\r
51 SetIndexEmptyValue(3,0);
\r
59 short_name = "Laguerre["+lag_p+"] \ MA => Max bars to count: |"+(Bars-1)+"| ";
\r
60 IndicatorShortName(short_name);
\r
64 for(shift=NumberOfBarsToCalculate-1;shift>=0;shift--){
\r
65 Lag[shift] = iCustom(NULL,0,"Laguerre RSI",lag_p,PRICE_CLOSE,shift);
\r
67 for(shift=NumberOfBarsToCalculate-1;shift>=0;shift--){
\r
68 Ma[shift] = iMAOnArray(Lag,0,MA_Period,MA_Shift,MA_Method,shift);
\r
69 Buffer0[shift] = Lag[shift];
\r
70 Buffer1[shift] = Ma[shift];
\r